#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

void fuck(vector<int>& v) {
    int c = 0;
    for (auto i = 0; i < v.size(); ++i) {
        int t = v[i] * 2 + c;
        v[i] = t % 10;
        c = t / 10;
    }
    if (c)
        v.push_back(c);
}

int main() {
    vector<int> v {1};
    for (int i = 0; i < 1000; ++i) {
        fuck(v);
    }
    cout << accumulate(v.begin(), v.end(), 0) << endl;
}